@use './variables' as *;

// 重置样式
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: $font-size-base;
  color: $text-primary;
  background-color: $background-color-base;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  height: 100%;
}

// 滚动条样式
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: $background-color-light;
  border-radius: $border-radius-base;
}

::-webkit-scrollbar-thumb {
  background: $text-secondary;
  border-radius: $border-radius-base;
  
  &:hover {
    background: $text-regular;
  }
}

// 通用样式类
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-start {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.flex-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

// 间距类
.m-0 { margin: 0 !important; }
.m-1 { margin: $spacing-base !important; }
.m-2 { margin: $spacing-large !important; }
.m-3 { margin: $spacing-larger !important; }
.m-4 { margin: $spacing-extra-large !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: $spacing-base !important; }
.mt-2 { margin-top: $spacing-large !important; }
.mt-3 { margin-top: $spacing-larger !important; }
.mt-4 { margin-top: $spacing-extra-large !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: $spacing-base !important; }
.mb-2 { margin-bottom: $spacing-large !important; }
.mb-3 { margin-bottom: $spacing-larger !important; }
.mb-4 { margin-bottom: $spacing-extra-large !important; }

.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: $spacing-base !important; }
.ml-2 { margin-left: $spacing-large !important; }
.ml-3 { margin-left: $spacing-larger !important; }
.ml-4 { margin-left: $spacing-extra-large !important; }

.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: $spacing-base !important; }
.mr-2 { margin-right: $spacing-large !important; }
.mr-3 { margin-right: $spacing-larger !important; }
.mr-4 { margin-right: $spacing-extra-large !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: $spacing-base !important; }
.p-2 { padding: $spacing-large !important; }
.p-3 { padding: $spacing-larger !important; }
.p-4 { padding: $spacing-extra-large !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: $spacing-base !important; }
.pt-2 { padding-top: $spacing-large !important; }
.pt-3 { padding-top: $spacing-larger !important; }
.pt-4 { padding-top: $spacing-extra-large !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: $spacing-base !important; }
.pb-2 { padding-bottom: $spacing-large !important; }
.pb-3 { padding-bottom: $spacing-larger !important; }
.pb-4 { padding-bottom: $spacing-extra-large !important; }

.pl-0 { padding-left: 0 !important; }
.pl-1 { padding-left: $spacing-base !important; }
.pl-2 { padding-left: $spacing-large !important; }
.pl-3 { padding-left: $spacing-larger !important; }
.pl-4 { padding-left: $spacing-extra-large !important; }

.pr-0 { padding-right: 0 !important; }
.pr-1 { padding-right: $spacing-base !important; }
.pr-2 { padding-right: $spacing-large !important; }
.pr-3 { padding-right: $spacing-larger !important; }
.pr-4 { padding-right: $spacing-extra-large !important; }

// 文本类
.text-primary { color: $text-primary !important; }
.text-regular { color: $text-regular !important; }
.text-secondary { color: $text-secondary !important; }
.text-placeholder { color: $text-placeholder !important; }

.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

.text-bold { font-weight: bold !important; }
.text-normal { font-weight: normal !important; }

// 字体大小类
.font-xs { font-size: $font-size-extra-small !important; }
.font-sm { font-size: $font-size-small !important; }
.font-md { font-size: $font-size-base !important; }
.font-lg { font-size: $font-size-large !important; }
.font-xl { font-size: $font-size-extra-large !important; }

// 边框类
.border { border: 1px solid $border-color-base !important; }
.border-top { border-top: 1px solid $border-color-base !important; }
.border-bottom { border-bottom: 1px solid $border-color-base !important; }
.border-left { border-left: 1px solid $border-color-base !important; }
.border-right { border-right: 1px solid $border-color-base !important; }

// 圆角类
.rounded { border-radius: $border-radius-base !important; }
.rounded-sm { border-radius: $border-radius-small !important; }
.rounded-lg { border-radius: $border-radius-large !important; }
.rounded-circle { border-radius: $border-radius-circle !important; }

// 阴影类
.shadow { box-shadow: $box-shadow-base !important; }
.shadow-sm { box-shadow: $box-shadow-light !important; }
.shadow-lg { box-shadow: $box-shadow-dark !important; }

// 过渡类
.transition { transition: all $transition-duration $transition-timing-function !important; }

// 溢出类
.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }
.overflow-scroll { overflow: scroll !important; }

// 显示类
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }

// 定位类
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed { position: fixed !important; }
.position-sticky { position: sticky !important; }

// 宽度和高度类
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.w-auto { width: auto !important; }
.h-auto { height: auto !important; }

// 鼠标样式类
.cursor-pointer { cursor: pointer !important; }
.cursor-default { cursor: default !important; }
.cursor-not-allowed { cursor: not-allowed !important; }

// 文本溢出省略号
.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

// 多行文本溢出省略号
.text-ellipsis-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

// 清除浮动
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

// 响应式工具类
@media (max-width: 768px) {
  .hidden-xs {
    display: none !important;
  }
}

@media (min-width: 769px) and (max-width: 992px) {
  .hidden-sm {
    display: none !important;
  }
}

@media (min-width: 993px) and (max-width: 1200px) {
  .hidden-md {
    display: none !important;
  }
}

@media (min-width: 1201px) {
  .hidden-lg {
    display: none !important;
  }
}

// Element Plus 样式覆盖
.el-card {
  --el-card-padding: 20px;
  border-radius: 4px;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  
  .el-card__header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
  }
}

.el-table {
  --el-table-border-color: #f0f0f0;
  --el-table-header-bg-color: #fafafa;
  
  .el-table__header th {
    font-weight: 600;
  }
}

.el-form {
  .el-form-item__label {
    font-weight: 500;
  }
}

.el-dialog {
  border-radius: 8px;
  
  .el-dialog__header {
    margin: 0;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .el-dialog__body {
    padding: 20px;
  }
  
  .el-dialog__footer {
    padding: 20px;
    border-top: 1px solid #f0f0f0;
  }
}

// 动画
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.slide-fade-enter-active,
.slide-fade-leave-active {
  transition: all 0.3s ease;
}

.slide-fade-enter-from,
.slide-fade-leave-to {
  transform: translateX(20px);
  opacity: 0;
} 